package com.solution.delegate;

import java.util.List;

import com.solution.exception.DelegateException;
import com.solution.exception.ServiceBeanException;
import com.solution.exception.ServiceLocatorException;
import com.solution.model.UserInfo;
import com.solution.model.UserQuestionMapping;
import com.solution.model.UserRole;
import com.solution.model.UserType;
import com.solution.service.UserInfoService;
import com.solution.util.SearchVO;
import com.solution.util.ServiceLocator;

public class UserInfoServiceDelegate implements UserInfoService {
	
	private UserInfoService userInfoService ;

	public UserInfoServiceDelegate() throws DelegateException{
		try {
			userInfoService = (UserInfoService)ServiceLocator.getInstance().getRemoteService("UserInfoService");
		} catch (ServiceLocatorException e) {
			throw new DelegateException(e); 
		}
	}	

	public void delete(Long userInfoId) throws ServiceBeanException {
		userInfoService.delete(userInfoId);
	}

	public UserInfo read(Long userInfoId) throws ServiceBeanException {
		return userInfoService.read(userInfoId);
	}

	public UserInfo update(UserInfo userInfo) throws ServiceBeanException {
		return userInfoService.update(userInfo);
	}
	
	public UserInfo updateUser(UserInfo userInfo) throws ServiceBeanException {
		return userInfoService.updateUser(userInfo);
	}
	public UserInfo create(UserInfo userInfo) throws ServiceBeanException {		
		return userInfoService.create(userInfo);	
	}
	public List<UserInfo> create(List<UserInfo> userInfoList) throws ServiceBeanException {		
		return userInfoService.create(userInfoList);	
	}

	public UserInfo getUserDetail(String userName) throws ServiceBeanException {
		return userInfoService.getUserDetail(userName);
	}

	public String encryptPassword(String password) throws ServiceBeanException {
		return userInfoService.encryptPassword(password);
	}

	public List<UserInfo> searchUser(SearchVO searchVO) throws ServiceBeanException {
		return userInfoService.searchUser(searchVO);
	}

	public List<UserRole> getUserRoleList(Long userID) throws ServiceBeanException {
		return userInfoService.getUserRoleList(userID);
	}

	public List<Long> getDealerList(Long userInfoId) throws ServiceBeanException {
		return userInfoService.getDealerList(userInfoId);
	}

	public boolean validateUserPassword(UserInfo userInfo) throws ServiceBeanException {		
		return userInfoService.validateUserPassword(userInfo);
	}

	public List<UserType> getUserTypeList(Long userID) throws ServiceBeanException {
		return userInfoService.getUserTypeList(userID);
	}
	public void createUserQuestionMappings(List<UserQuestionMapping> userQuestionMappings) 
	throws ServiceBeanException{
		userInfoService.createUserQuestionMappings(userQuestionMappings);
	}

	public List<UserQuestionMapping> searchUserQuestionMappings(SearchVO searchVO) throws ServiceBeanException {		
		return userInfoService.searchUserQuestionMappings(searchVO);
	}
	
	public Integer countUser(SearchVO searchVO) throws ServiceBeanException{
		return userInfoService.countUser(searchVO);
	}
}
